package com.iwith.dongmoon.activity;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.webkit.WebView;
import android.widget.Button;

import com.iwith.dongmoon.gsonlist.BoardList;
import com.iwith.dongmoon.util.RequestGson;
import com.iwith.dongmoon.util.ResultCode;

public class SignUpWelcomeActivity extends Activity {
	private RequestGson requestGson = new RequestGson();
	private BoardList message;
	private WebView welcomeText;
	private Button nextBt;

	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		// TODO Auto-generated method stub
		setContentView(R.layout.signup_welcome);

		
	}

	@Override
	public void onResume() {
		super.onResume();
		Initialize();
	}

	private void Initialize() {
		setViewId();
		message = requestGson.getBoardGsonBySendingAPI(this, "/welcome", "GET", "");

		if (message.getResultCode().equals(ResultCode.SUCCESS) == true) {

			welcomeText.loadDataWithBaseURL("a", message.getResultMessage(),
					"text/html", "UTF-8", null);
		} else {
			requestGson.alertToast(this, "데이터 로딩 실패");
		}
		nextBt.setOnClickListener(new OnClickListener() {
			public void onClick(View v) {
				// TODO Auto-generated method stub
				finish();
			}
		});

	}

	private void setViewId() {
		welcomeText = (WebView) findViewById(R.id.signup_welcome_text);
		nextBt = (Button) findViewById(R.id.signup_welcome_nextbt);
	}
}
